#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main (int argc, char const* argv[])
{
    int n, a[1024], b[1024], c[1024], i, start, cnt;
    char buf[1024];

    scanf("%d", &n);
    cnt = 1;
    while (n--) {
        memset(a, 0, sizeof(a));
        memset(b, 0, sizeof(b));
        memset(c, 0, sizeof(c));
        printf("Case %d:\n", cnt);

        scanf("%s", buf);
        for (i = strlen(buf)-1; i >= 0; i--) {
            a[strlen(buf)-i-1] = buf[i] - '0';
        }
        printf("%s", buf);
        printf(" + ");
        scanf("%s", buf);
        for (i = strlen(buf)-1; i >= 0; i--) {
            b[strlen(buf)-i-1] = buf[i] - '0';
        }
        printf("%s", buf);
        printf(" = ");

        for (i = 0; i < 1002; i++) {
            c[i] += a[i] + b[i];
            if (c[i] > 9) {
                c[i] = c[i] % 10;
                c[i+1] = c[i+1] + 1;
            }
        }

        start = 0;
        for (i = 1002; i >= 0; i--) {
            if (start > 0 || c[i] > 0) {
                printf("%d", c[i]);
                start = 1;
            }
        }
        printf("\n");

        if (n != 0) {
            printf("\n");
        }

        ++cnt;
    }

    return 0;
}
